<template>
	<view class="container">
		<uni-section title="食物评论列表展示" sub-title="" type="line" >
			<uni-list>
				<uni-list-item :title="item.comment" note="" ></uni-list-item>
				<uni-list-item title="评论内容" note=""  ></uni-list-item>
			</uni-list>
		</uni-section>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				item:{},
				id:''
			}
		},
		methods: {
			get(){
				uni.request({
					url: 'http://localhost:8090/foodapp/comment/findone',
					method: 'POST',
					data: {
						id:this.id
					},
					success: res => {
						if(res.data.success){
							console.log("成功");
							this.item=res.data.data
							console.log(this.item);
						}
					},
					fail: () => {},
					complete: () => {}
				});
		},
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
				console.log(option.id); //打印出上个页面传递的参数
				
				 this.id=option.id
				 console.log(this.id);
				 
			},
			onShow(){
				this.get()
			}
	},
}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>
